<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<base href='<?php echo base_url()?>'>
<link rel="stylesheet" type="text/css" href="public/common/css/common.css"/>
<link rel="stylesheet" type="text/css" href="public/admin/css/admin.css"/>
<script src="public/common/js/jquery.js"></script>
<script>
$(function(){
	$('.table tr').hover(function(){
		$(this).children('td').css('background','#ccffcc');
	},function(){
		$(this).children('td').css('background','white');
	});	
	get_ad_style();
});
function get_ad_style()
{
	$.post('<?php echo site_url("admin/ad/get_ad_style")?>',{category_id:$('select[name="category_name"]').val()},function(result){
			result_json = eval('('+result+')');
			$('input[name="ad_width"]').val(result_json.ad_width);
			$('input[name="ad_height"]').val(result_json.ad_height);
			$('select[name="ad_style"]').val(result_json.ad_style);
		});
}
</script>
</head>
<body>
	<div class="body">
    	<?php echo $this->position->get_position();?>
    	<div class="body_center">
        <form action="<?php echo site_url('admin/ad/update_config')?>" method="post">
            <table class="table" style="margin-bottom:0px;">
            	 <tr><th width='20%'>参数名</th><th width='55%'>参数值</th><th width='25%'>参数说明</th></tr>
                <tr><td class="center">分类名称：</td><td>
				<select name="category_name" onchange='get_ad_style()'>
                <?php foreach($category->result() as $value):?>
                 <option value="<?php echo $value->category_id?>"><?php echo $value->category_name?></option>
                <?php endforeach;?>
               <?php echo $ad_style?>
                </select></td><td><span class="red">*</span> 样式所属分类</td></tr>
                 <tr><td class="center">广告宽度：</td><td ><input type="text" class='input_txt border_none' name="ad_width" value=""  />px</td><td >&nbsp;</td></tr>
                  <tr><td class="center">广告高度：</td><td><input type="text" class='input_txt border_none' name="ad_height" value=""  />px</td><td>&nbsp;</td></tr>
                   <tr><td class="center">广告样式：</td><td>
				   <select name='ad_style'>
						<option value='1'>样式1</option>
						<option value='2'>样式2</option>
						<option value='3'>样式3</option>
						<option value='4'>样式4</option>
				   </select></td><td>&nbsp;</td></tr>
           		<tr><td>&nbsp;</td><td  colspan="2"><input type="submit" class="submit" value="提交" /> &nbsp;&nbsp;<input type="reset" class="reset" value="重置" /></td></tr>
            </table>
        </form>
        </div>
    </div>
</body>
</html>